<{capture name="header"}>
    <{css app="ome" src="ome.css"}>
    <link href="statics/singlepage.css" rel="stylesheet" type="text/css">
<{/capture}>

<{if $checkType=='barcode' || $checkType=='all'}>
    <div class="tableform">
        <div style="padding-left: 80px; font-size: 2.5em;font-weight: 700;">
            货品校验<span class="num">(目前还有<em class="count" style="font-weight:700;font-size:2.5em;color: red;"><{$num}></em>个发货单未校验)</span>
        </div>

        <div id="main" class="division">
        <form method="post" action="index.php?app=wms&ctl=admin_check&act=check" id='delivery-check-form'>
            <input type="hidden" id="checkType" name="checkType" value="<{$checkType}>" />
            <table width="100%" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                <tr>
                    <td width="55px">&nbsp;</td>
                    <td>
                        <span style="font-size: 1.5em;font-weight: bold;">请输入快递单号：</span>(建议使用条码枪扫描)<br />
                        <input type="text" id="delivery" vtype="required" name="delivery[logi_no]" style="margin-top: 10px;background: none repeat scroll 0 0 #FAFAFA;border: 2px solid #CCCCCC;border-radius: 10px 10px 10px 10px;color: #069CBC;font-size: 30px;height: 45px;line-height: 40px;margin-bottom: 10px;padding-left: 19px;width: 400px;" > <span style="color: red;"></span>
                        <button type="submit" id="submit" style="margin-top: -10px;margin-left: 25px;font-size:3.0em;font-weight: 700; height: 50px; width:120px;cursor: pointer;display: -moz-inline-stack;line-height: 40px;overflow: visible;text-decoration: none;vertical-align: middle;" ><span><span>确定</span></span></button>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
        </div>
    </div>
    <script>
    $('delivery').focus();
    var _request = 1;
    function requestCheck(e){
        if(_request != 1) return;

        new Request({
            url:$('delivery-check-form').action,
            data:$('delivery-check-form'),
            method:'post',
            evalScripts:true,
            onRequest:function(){
                _request = 0;
            },
            onSuccess:function(resp){
                if ((/text\/jcmd/).test(this.getHeader('Content-type'))) {
                    resp = JSON.decode(resp);
                    if (resp.error)
                    {
                        new MessageBox(resp.error,{
                            type:'error',
                            onHide:function(){
                                _request = 1;
                            },
                            autohide: (resp.autohide || 1500)
                        });
                    
                        try{
                            if (typeof(voiceWarning) == 'function')
                            {
                                var arg0 = resp.error ? 0 : 1;
                                voiceWarning(arg0);
                            }
                        }catch(e){}
                        
                        $('delivery').select();

                        return;
                    } else {
                        W.page('index.php?app=wms&ctl=admin_check&act=check',{
                            data:{
                                'checkType':resp.checkType,
                                'logi_no':resp.logi_no,
                                'pass':resp.pass,
                            },
                            method:'post',
                            update:$('main'),
                        });
                    }
                }

                //$('delivery-check-form').fireEvent('submit',e);
            },
            onComplete:function(){
            }
        }).send();
    }

    $('submit').removeEvent('click').addEvent('click',function(e){
        e.stop();
        requestCheck(e);
    });
    </script>
    <{include file='admin/delivery/voice_warning.html'}>
<{else}>
    <div>你无权访问此页面！</div>
<{/if}>
